﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SiteSimc.master" AutoEventWireup="true" CodeFile="Filtros.aspx.cs" Inherits="Administracion_Filtros" %>


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:Label ID="lblMensajeError" runat="server" ForeColor="Red"></asp:Label>
<table width="927px" >
        <tr>
            <td>
                <asp:UpdatePanel ID="udpCrearFiltro" runat="server" 
                    UpdateMode="Conditional">
                    <ContentTemplate>
                        <table runat="server" id="Table1" visible="true" width="100%"  >
                            <tr>
                                <td class="tabla_verde" style="font-size: small; font-weight: bold; color: #FFFFFF; " valign="middle" >                                       
                                    &nbsp;                                       
                                    <asp:LinkButton ID="btnCrearFiltro"  runat="server" ForeColor="White"  onclick="btnCrearFiltro_Click" >Crear Filtro</asp:LinkButton>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <table width="100%" runat="server" id="tblCrearFiltro" visible="false" style="background-color:White" 
                                         >
                                        <tr>
                                            <td valign="middle" style="font-weight:bold">
                                                Descripción:&nbsp;&nbsp;&nbsp; </td>
                                            <td style="width:346px;" valign="middle">
                                                <asp:TextBox ID="txtDescripcion" runat="server" Width="318px" 
                                                    style="margin-right: 0px"></asp:TextBox>
                                                    
                                            </td>
                                            <td style="width:47px; font-weight:bold" valign="middle">
                                                Query:&nbsp;&nbsp;&nbsp; </td>
                                            <td valign="middle" >
                                                <asp:TextBox ID="txtQuery" runat="server" Width="424px" 
                                                    TextMode="MultiLine" Height="51px"></asp:TextBox>                                                                                                    
                                                <br />                                                                                                    
                                            </td>
                                               
                                        </tr>
                                        
                                    </table>  
                                    <table runat="server" id="tblGuardarFiltro" visible="false" >
                                        <tr>
                                          
                                            <td style="width:763px; ">                                                
                                                <asp:RequiredFieldValidator ID="DescripcionRequerida" runat="server" 
                                                    ControlToValidate="txtDescripcion" CssClass="failureNotification" 
                                                    ErrorMessage="La Descripción es requerida." 
                                                    Display="Dynamic"></asp:RequiredFieldValidator>
                                                <br />
                                                <asp:RequiredFieldValidator ID="QueryRequerido" runat="server" 
                                                    ControlToValidate="txtQuery" CssClass="failureNotification" 
                                                    ErrorMessage="El Query es requerido." 
                                                    Display="Dynamic"></asp:RequiredFieldValidator>
                                            </td>
                                            <td>                                            
                                                <asp:Button ID="btnGuardarFiltro" runat="server" 
                                                Height="32px" Text="Guardar" 
                                                Width="77px" onclick="btnGuardarFiltro_Click" />
                                                                                                                             
                                            </td>
                                            <td>                                            
                                                <asp:Button ID="btnCancelarFiltro" runat="server" 
                                                Height="32px" Text="Cancelar" 
                                                Width="77px" onclick="btnCancelarFiltro_Click" CausesValidation="false"/>
                                                                                                                             
                                            </td>
                                        </tr>
                                    </table>                                              
                                       
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnCrearFiltro" EventName="Click" />
                    </Triggers>
                </asp:UpdatePanel>
            </td>
        </tr>        
        <tr>
            <td>
                <br />        
                <h4>                    
                   Filtros
                </h4>
                
            </td>           
        </tr>     
        <tr>
            <td  >
            <asp:UpdatePanel runat="server" UpdateMode="Conditional">
             <ContentTemplate>
                <asp:GridView ID="gvFiltros" runat="server" DataKeyNames="Id" AutoGenerateColumns="False"
                    CellPadding="3" GridLines="Horizontal"                    
                    BackColor="White" 
                    BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" Width="823px"                      
                    onselectedindexchanged="gvFiltros_SelectedIndexChanged">                    
                    <AlternatingRowStyle BackColor="#F7F7F7" />
                    <Columns>
                            <asp:BoundField DataField="Descripcion" HeaderText="Descripción">
                                <HeaderStyle HorizontalAlign="Left" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                                
                            <asp:BoundField DataField="Query" HeaderText="Query" ReadOnly="True">                            
                                <HeaderStyle HorizontalAlign="Left" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>       
                            <asp:CommandField SelectText="Ver Detalles" ShowHeader="True" 
                                 ShowSelectButton="True"  >
                                 <ControlStyle ForeColor="Blue"></ControlStyle>
                            </asp:CommandField>                     
                           
                    </Columns>
                    <FooterStyle CssClass="GridViewFooterStyle" />
                    <HeaderStyle CssClass="GridViewHeaderStyle" />
                    <PagerStyle CssClass="GridViewPagerStyle" />
                    <RowStyle CssClass="GridViewRowStyle" />
                    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                    <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                </asp:GridView>
                </ContentTemplate>
                     <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnGuardarFiltro" EventName="Click" />
                        <asp:AsyncPostBackTrigger ControlID="gvFiltros" EventName ="SelectedIndexChanged" />
                    </Triggers>
                </asp:UpdatePanel>
            </td>
        </tr>        
    </table>
    
                <br />
                <br />
                <br />
                <br />
</asp:Content>

